package com.ldkj.panzh.controller;

import com.ldkj.panzh.domain.AjaxResult;
import com.ldkj.panzh.domain.TableDataInfo;
import com.ldkj.panzh.param.VehicleQueryParam;
import com.ldkj.panzh.service.VehicleInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 车辆信息查询 控制器
 *
 * @author qiancheng
 * @date 2025-11-19
 */
@Controller
public class VehicleInfoController extends BaseController {

    @Autowired
    VehicleInfoService vehicleInfoService;

    /**
     * 查询车辆列表
     *
     * @param vehicleQueryParam 查询参数
     * @return 车辆列表
     * @throws Exception
     */
    @RequestMapping("/queryVehicleList")
    @ResponseBody
    public TableDataInfo queryVehicleList(@RequestBody VehicleQueryParam vehicleQueryParam) throws Exception {
        return getDataTable(vehicleInfoService.queryVehicleList(vehicleQueryParam));
    }

    /**
     * 查询车辆统计信息
     *
     * @param vehicleQueryParam 查询参数
     * @return 统计数据
     * @throws Exception
     */
    @RequestMapping("/queryVehicleListStats")
    @ResponseBody
    public AjaxResult queryVehicleListStats(@RequestBody VehicleQueryParam vehicleQueryParam) throws Exception {
        return success(vehicleInfoService.queryVehicleStats(vehicleQueryParam));
    }
}
